package com.ebraga.trackerclub.android.dao.api.webservice;

import java.util.Collection;

import com.ebraga.trackerclub.android.exception.dao.BackofficeConnectionWebServicesException;
import com.ebraga.trackerclub.android.exception.dao.BackofficeIllegalArgumentDaoException;
import com.ebraga.trackerclub.android.exception.dao.BackofficeInvalidURLWebServicesException;
import com.ebraga.trackerclub.android.exception.dao.BackofficeWebServicesException;


/**
 * Provides methods to send entity data to the server.
 * @param <E> the entity to be send to the web server.
 */
public interface EntityWSDao<E> {

	/**
	 * Sends to the web service a list of entities to be persisted. 
	 * 
	 * @param entityList a list of entities to be persisted.
	 * @throws BackofficeWebServicesException if occurs another error.
	 * @throws BackofficeInvalidURLWebServicesException if the URL is invalid.
	 * @throws BackofficeIllegalArgumentDaoException if an illegal argument is found. 
	 * @throws BackofficeConnectionWebServicesException if a connection error.
	 */
	boolean insert(Collection<E> entityList) throws BackofficeWebServicesException, 
		BackofficeInvalidURLWebServicesException, BackofficeConnectionWebServicesException, BackofficeIllegalArgumentDaoException;
}
